/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.hyjiacan.deadqq.client.window;

import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.LayoutStyle;
import javax.swing.WindowConstants;

/**
 * 
 * @author hyjiacan
 */
public class AddContactConfirmWindow extends JDialog {
	/**
	 * 
	 */
	private static final long serialVersionUID = 4726581059517844958L;
	public static final int TYPE_SEND = 1001;
	public static final int TYPE_ACCEPT = 1002;

	/**
	 * Creates new form AddContactConfirmWindow
	 */
	public AddContactConfirmWindow(java.awt.Frame parent, boolean modal,
			int type, long number) {
		super(parent, modal);
		initComponents();

		String tip = "";
		if (type == TYPE_SEND) {
			tip = "You are adding " + number + " to your contacts.";
		} else if (type == TYPE_ACCEPT) {
			tip = number + " add you to his/her contacts.";
		}

		addContactTip.setText(tip);
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	// <editor-fold defaultstate="collapsed"
	// desc="Generated Code">//GEN-BEGIN:initComponents
	private void initComponents() {

		addContactTip = new JLabel();
		groupList = new JComboBox<String>();
		groupslb = new JLabel();
		cancel = new JButton();
		ok = new JButton();

		setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

		groupslb.setText("Groups");

		cancel.setText("Cancel");

		ok.setText("OK");

		GroupLayout layout = new GroupLayout(getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(
										layout.createParallelGroup(
												GroupLayout.Alignment.LEADING)
												.addGroup(
														layout.createSequentialGroup()
																.addPreferredGap(
																		LayoutStyle.ComponentPlacement.RELATED,
																		74,
																		Short.MAX_VALUE)
																.addComponent(
																		cancel,
																		GroupLayout.PREFERRED_SIZE,
																		80,
																		GroupLayout.PREFERRED_SIZE)
																.addGap(18, 18,
																		18)
																.addComponent(
																		ok,
																		GroupLayout.PREFERRED_SIZE,
																		71,
																		GroupLayout.PREFERRED_SIZE))
												.addComponent(
														addContactTip,
														GroupLayout.DEFAULT_SIZE,
														GroupLayout.DEFAULT_SIZE,
														Short.MAX_VALUE)
												.addGroup(
														layout.createSequentialGroup()
																.addComponent(
																		groupslb)
																.addPreferredGap(
																		LayoutStyle.ComponentPlacement.UNRELATED)
																.addComponent(
																		groupList,
																		0,
																		GroupLayout.DEFAULT_SIZE,
																		Short.MAX_VALUE)))
								.addContainerGap()));
		layout.setVerticalGroup(layout.createParallelGroup(
				GroupLayout.Alignment.LEADING).addGroup(
				layout.createSequentialGroup()
						.addContainerGap()
						.addComponent(addContactTip)
						.addGap(18, 18, 18)
						.addGroup(
								layout.createParallelGroup(
										GroupLayout.Alignment.BASELINE)
										.addComponent(groupList,
												GroupLayout.PREFERRED_SIZE,
												GroupLayout.DEFAULT_SIZE,
												GroupLayout.PREFERRED_SIZE)
										.addComponent(groupslb))
						.addGap(18, 18, 18)
						.addGroup(
								layout.createParallelGroup(
										GroupLayout.Alignment.BASELINE)
										.addComponent(cancel).addComponent(ok))
						.addContainerGap(GroupLayout.DEFAULT_SIZE,
								Short.MAX_VALUE)));

		pack();
	}// </editor-fold>//GEN-END:initComponents

	// Variables declaration - do not modify//GEN-BEGIN:variables
	private JLabel addContactTip;
	private JButton cancel;
	private JComboBox<String> groupList;
	private JLabel groupslb;
	private JButton ok;
	// End of variables declaration//GEN-END:variables
}
